﻿/**
* @projectName   aaa
* @brief         摘要
* @author        Feng
* @date          2022-01-17 13:44:21
*/

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPainter>
#include <QObject>
#include <QAbstractButton>
#include <QMap>
#include <QThread>
#include <QtCharts/QChart>
#include <QBarSet>
#include <QBarSeries>
#include <QBarCategoryAxis>
#include <QValueAxis>
#include <QSplineSeries>

#include "xpushbuttonfunction.h"
#include "xpushbutton.h"
#include "xstaticchart.h"

#include "objlib.h"

#include "qcustomplot.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

using namespace QtCharts;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    int r, g, b;

    void draw();

private:
    Ui::MainWindow *ui;

    Array data{"Integer"};

    Function func = nullptr;
    XPushButtonFunction *pushButtonFunctionA = nullptr;
    XPushButtonFunction *pushButtonFunctionB = nullptr;
    XPushButtonFunction *pushButtonFunctionC = nullptr;
    XPushButtonFunction *pushButtonFunctionD = nullptr;
    XCoil *coilA = nullptr;
    XCoil *coilB = nullptr;
    XCoil *coilC = nullptr;
    XCoil *coilD = nullptr;
    XCoil *coilE = nullptr;
    XCoil *coilF = nullptr;

    XRegister *registerA = nullptr;
    XRegister *registerB = nullptr;
    XRegister *registerC = nullptr;
    XRegister *registerD = nullptr;

    XPushButtonFourArithmetic *pushButtonFourArithmetic = nullptr;

    void message();

    QTimer *timer;

    XPushButton *pushButton;

    QChart *m_chart;

    XStaticChart *myChart;

private slots:
   void RColor_valuechanged(int value);
   void GColor_valuechanged(int value);
   void BColor_valuechanged(int value);
   void set(bool res);

private Q_SLOTS:
    void updateUI();
};
#endif // MAINWINDOW_H
